using SharePoint.Security.ConfigAnalyzer.Engine.Base;
using SharePoint.Security.ConfigAnalyzer.Engine.Common;

namespace SharePoint.Security.ConfigAnalyzer.Engine.Rules.Antivirus
{
    public class CleaningEnabled : BaseRule
    {
        #region Overrides of BaseRule

        public CleaningEnabled()
        {
            RuleInfo = Constants.RuleInfos[Constants.AntiVirusCleaningEnabled];
        }

        public override void Validate()
        {
            var settings = ObjectHelper.AvSettings;
            if (settings.CleaningEnabled)
            {
                this.Status = Status.Pass;
                this.CurrentValue = "Enabled";
            }
            else
            {
                this.Status = Status.Fail;
                this.CurrentValue = "Not Enabled";
            }
        }

        #endregion
    }
}